/*
 * @Descripttion: 
 * @version: 
 * @Author: Hq747
 * @Date: 2021-07-02 20:00:51
 * @LastEditors: Hq747
 * @LastEditTime: 2021-07-04 15:00:11
 */
// 导入axios
// 导入axios
import { get, post, post_json } from '@/http/axios'
export default {
  namespaced: true,
  state: {
    // 订单数据
    orderData:[]
  },
  mutations: {
    SET_ORDERDATA(state, payload){
      state.orderData = payload
    }
  },
  actions: {
    // 获取全部订单的数据
    async getAllOrderData({commit}, payload){
      let res = await get('/order/pageQuery', payload)
      commit('SET_ORDERDATA', res.data.data.list)
    },
    // 接受订单
    async take({commit}, payload){
      let res = await get('/order/takeOrder', payload)
    },
    // 拒绝订单
    async reject({commit}, payload){
      let res = await get('/order/rejectOrder', payload)
    },
    // 确认订单（结束服务）
    async onfirm({commit}, payload){
      let res = await get('/order/serviceCompleteOrder', payload)
    },
  }
}